import React from 'react';
import './App.scss';
import RouterView from './router/RouterView'
import {BrowserRouter,NavLink} from 'react-router-dom'
import routes from './router/router-config'
import './mock/mock'
import {Provider} from 'react-redux'
import store from './store/index'

class App extends React.Component {

    render(){
        let nav=routes.filter(item=>item.text)
        return (
            <Provider store={store}>
                <BrowserRouter>
                <div className="wrap">
                    <main>
                        <RouterView routes={routes}/>
                    </main>
                    <footer>
                        {
                            nav.map((item,index)=>{
                                return <NavLink key={index} to={item.path}>{item.text}</NavLink>
                            })
                        }
                    </footer>
                </div>
                </BrowserRouter>
            </Provider>
        );
    }
}

export default App;
